package com.qt.socket.tcpwork;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author zsf
 * @Date 2023/10/5 2:47
 * @Version 1.0
 */
public class TcpReceive {

    public static void main(String[] args) throws IOException {

        ServerSocket ss = new ServerSocket(8888);
        Socket socket = ss.accept();
        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));

        String line;
        while ((line = br.readLine()) != null){
            System.out.println(line);
        }
        br.close();
        socket.close();


    }

}
